import {ADDITION,SUBTRACTION} from '@/store/action/actionTypes'
/*
    编写计数器的reduce
*/
const counterReduce=(state={
    count:10
},action)=>{
    switch(action.type){
        case ADDITION:
            return {...state,count:state.count+action.num}
        case SUBTRACTION:
            return {...state,count:state.count-action.num}
        default:
            return state
    }
}
export default counterReduce